home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bossa.arc / BOSS_SUP.ARC / WINDOWS.H < prev    next >
C/C++ Source or Header  |  1990-03-12  |  25KB  |  726 lines

  1. /*
  2. ** WINDOWS - Simple but Elegant Window Functions 
  3. **           (Lattice, Computer Innovations, Microsoft, 
  4. **            Datalight, Aztec, Watcom, Mix Power C)
  5. **
  6. ** Copyright (c) 1984, 1985, 1986 - Philip A. Mongelluzzo
  7. ** All rights reserved.
  8. **
  9. */
  10.  
  11. /*
  12. ** Truth, Lies, and Compiler Options 
  13. **
  14. ** Various equates for the various compilers.
  15. **
  16. ** Basic compiler invocation is:
  17. **
  18. ** AZTEC C
  19. **
  20. **      cc -DAZTEC -DMSCV3 -DSPTR=1 sourcefile_name  (Small Model)
  21. **
  22. ** WATCOM C
  23. **
  24. **      WCC sourcefile_name /dMSCV4=1 /dWATCOM=1
  25. **
  26. ** BORLAND Turbo C
  27. **
  28. **      TCC -DBORLAND=1 sourcefile_name;
  29. **
  30. ** Microsoft 3.X
  31. **
  32. **      MSC -dMSCV3 sourcefile_name;
  33. **
  34. ** Microsoft 4.X
  35. **
  36. **      MSC -dMSCV4 sourcefile_name;
  37. **
  38. ** Microsoft 5.X
  39. **
  40. **      cl /DMSCV4=1 sourcefile_name /c;
  41. **
  42. ** Microsoft QuickC
  43. **
  44. **      qcl /DMSCV4=1 sourcefile_name /c;
  45. **
  46. ** Mix Power C
  47. **
  48. **      pc /DMSCV4=1 /DM_I86CM=1 sourcefile_name
  49. **
  50. ** Lattice 2.XX 
  51. **
  52. **      LCS -dLC2 sourcefile_name
  53. **
  54. ** Lattice 3.XX
  55. **
  56. **      LCS -dLC3 sourcefile_name
  57. **
  58. ** Lattice 6.XX
  59. **
  60. **      LCS -dLC6 sourcefile_name
  61. **
  62. ** Datalight
  63. **
  64. **      DLC1 -dDLC -p -w -mS sourcefile_name
  65. **      DLC2 sourcefile_name -S
  66. **
  67. ** Computer Innovations CI86
  68. **
  69. **      cc1 -cm -dC86 sourcefile_name
  70. **      cc2 ...
  71. **
  72. */
  73.  
  74. /*
  75. ** Computer Innovations comes first....
  76. */
  77.  
  78. #ifdef C86
  79. #define BORLAND 0
  80. #define MSCV3   0
  81. #define MSCV4   0
  82. #define MSC     0
  83. #define MSC3    0
  84. #define MSC4    0
  85. #define DLC     0
  86. #define CI86    1
  87. #define LC2     0
  88. #define LC3     0
  89. #define LC6     0
  90. #define __ZTC__ 0
  91. #define MIXPC   0
  92. #define AZTEC   0
  93. #define WATCOM  0
  94. #ifdef _C86_BIG
  95. #define LPTR    1
  96. #define SPTR    0
  97. #else
  98. #define LPTR    0
  99. #define SPTR    1
  100. #endif
  101. #define LATTICE 0
  102. #define void int                        /* define void as int */
  103. struct WORDREGS {                       /* register layout is */
  104.         unsigned int ax;                /* different from the rest !! */
  105.         unsigned int bx;
  106.         unsigned int cx;
  107.         unsigned int dx;
  108.         unsigned int si;
  109.         unsigned int di;
  110.         unsigned int ds;                /* <= NB */
  111.         unsigned int es;                /* <= NB */
  112.         unsigned int flags;
  113.         };
  114. struct BYTEREGS {
  115.         unsigned char al, ah;
  116.         unsigned char bl, bh;
  117.         unsigned char cl, ch;
  118.         unsigned char dl, dh;
  119.         };
  120. union REGS {
  121.         struct WORDREGS x;
  122.         struct BYTEREGS h;
  123.         };
  124. struct SREGS {
  125.         unsigned int cs;
  126.         unsigned int ss;
  127.         unsigned int ds;
  128.         unsigned int es;
  129.         };
  130. extern unsigned wns_mtype();            /* make everyone happy */
  131. #endif                                  /* end C86 Stuff */
  132.  
  133.  
  134. #if WATCOM
  135. #pragma aux v_stksp "_*" parm caller []                           \
  136.                          value struct float struct routine [ax]   \
  137.                          modify [ax bx cx dx es]; 
  138.  
  139. #pragma aux _putca "_*" parm caller []                           \
  140.                          value struct float struct routine [ax]   \
  141.                          modify [ax bx cx dx es]; 
  142.  
  143. #pragma aux _getca "_*" parm caller []                           \
  144.                          value struct float struct routine [ax]   \
  145.                          modify [ax bx cx dx es]; 
  146.  
  147. #pragma aux _absloc "_*" parm caller []                           \
  148.                          value struct float struct routine [ax]   \
  149.                          modify [ax bx cx dx es]; 
  150.  
  151. #pragma aux v_wca "_*" parm caller []                           \
  152.                          value struct float struct routine [ax]   \
  153.                          modify [ax bx cx dx es];
  154.  
  155. #pragma aux v_wtty "_*" parm caller []                           \
  156.                          value struct float struct routine [ax]   \
  157.                          modify [ax bx cx dx es]; 
  158.  
  159. #pragma aux v_cls "_*" parm caller []                           \
  160.                          value struct float struct routine [ax]   \
  161.                          modify [ax bx cx dx es];
  162.  
  163. #pragma aux v_spage "_*" parm caller []                           \
  164.                          value struct float struct routine [ax]   \
  165.                          modify [ax bx cx dx es]; 
  166.  
  167. #pragma aux v_smode "_*" parm caller []                           \
  168.                          value struct float struct routine [ax]   \
  169.                          modify [ax bx cx dx es]; 
  170.  
  171. #pragma aux v_locate "_*" parm caller []                           \
  172.                          value struct float struct routine [ax]   \
  173.                          modify [ax bx cx dx es]; 
  174.  
  175. #pragma aux v_hidec "_*" parm caller []                           \
  176.                          value struct float struct routine [ax]   \
  177.                          modify [ax bx cx dx es]; 
  178.  
  179. #pragma aux v_sapu "_*" parm caller []                           \
  180.                          value struct float struct routine [ax]   \
  181.                          modify [ax bx cx dx es]; 
  182.  
  183. #pragma aux v_sapd "_*" parm caller []                           \
  184.                          value struct float struct routine [ax]   \
  185.                          modify [ax bx cx dx es]; 
  186.  
  187. #pragma aux v_rcpos "_*" parm caller []                           \
  188.                          value struct float struct routine [ax]   \
  189.                          modify [ax bx cx dx es]; 
  190.  
  191. #pragma aux v_rcvs "_*" parm caller []                           \
  192.                          value struct float struct routine [ax]   \
  193.                          modify [ax bx cx dx es]; 
  194.  
  195. #pragma aux v_getch "_*" parm caller []                           \
  196.                          value struct float struct routine [ax]   \
  197.                          modify [ax bx cx dx es]; 
  198.  
  199. #pragma aux v_kflush "_*" parm caller []                           \
  200.                          value struct float struct routine [ax]   \
  201.                          modify [ax bx cx dx es]; 
  202.  
  203. #pragma aux v_kstat "_*" parm caller []                           \
  204.                          value struct float struct routine [ax]   \
  205.                          modify [ax bx cx dx es]; 
  206.  
  207. #pragma aux v_sctype "_*" parm caller []                           \
  208.                          value struct float struct routine [ax]   \
  209.                          modify [ax bx cx dx es]; 
  210.  
  211. #pragma aux xferdata "_*" parm caller []                           \
  212.                          value struct float struct routine [ax]   \
  213.                          modify [ax bx cx dx es]; 
  214.  
  215. #pragma aux v_border "_*" parm caller []                           \
  216.                          value struct float struct routine [ax]   \
  217.                          modify [ax bx cx dx es]; 
  218.  
  219. #pragma aux _vidblt "_*" parm caller []                           \
  220.                          value struct float struct routine [ax]   \
  221.                          modify [ax bx cx dx es]; 
  222.  
  223. #pragma aux _putca "_*" parm caller []                           \
  224.                          value struct float struct routine [ax]   \
  225.                          modify [ax bx cx dx es]; 
  226. #endif
  227.  
  228. /*
  229. ** Microsoft 4.0, 5.X, QuickC, PowerC
  230. */
  231.  
  232. #if MSCV4
  233. #define MSC     1
  234. #define MSCV3   0
  235. #define MSC4    1
  236. #define DLC     0
  237. #define CI86    0
  238. #define LC2     0
  239. #define LC3     0
  240. #define BORLAND 0
  241. #ifndef MIXPC
  242. #define MIXPC   0
  243. #endif
  244. #define AZTEC   0
  245. #ifdef M_I86SM                          /* small code, small data */
  246. #define SPTR    1
  247. #define LPTR    0
  248. #endif
  249. #ifdef M_I86LM                          /* large code, large data */
  250. #define SPTR    0
  251. #define LPTR    1
  252. #endif
  253. #ifdef M_I86CM                          /* small code, large data */
  254. #define SPTR    0
  255. #define LPTR    1
  256. #endif
  257. #ifdef M_I86MM                          /* large code, small data */
  258. #define SPTR    1
  259. #define LPTR    0
  260. #endif
  261. #define LATTICE 1
  262. #endif
  263.  
  264. /*
  265. ** Microsoft 3.00
  266. */
  267.  
  268. #if MSCV3
  269. #define MSC     1
  270. #define MSC4    0
  271. #define DLC     0
  272. #define CI86    0
  273. #define LC2     0
  274. #define LC3     0
  275. #define BORLAND 0
  276. #define MIXPC   0
  277. #ifndef AZTEC
  278. #define AZTEC   0
  279. #endif
  280. #ifdef M_I86SM                          /* small code, small data */
  281. #define SPTR    1
  282. #define LPTR    0
  283. #endif
  284. #ifdef M_I86LM                          /* large code, large data */
  285. #define SPTR    0
  286. #define LPTR    1
  287. #endif
  288. #ifdef M_I86CM                          /* small code, large data */
  289. #define SPTR    0
  290. #define LPTR    1
  291. #endif
  292. #ifdef M_I86MM                          /* large code, small data */
  293. #define SPTR    1
  294. #define LPTR    0
  295. #endif
  296. #define LATTICE 1
  297. #endif
  298.  
  299. /*
  300. ** Lattice 6.XX
  301. */
  302.  
  303. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  304. #define BORLAND 1                       /* from a code standpoint */
  305. #undef NULL                             /* NULL must be redefined */
  306. #define NULL 0                          /* to avoid useless errors */
  307. #endif                                  /* any changes here must also */
  308.                                         /* be made in "windows.c" */
  309.  
  310. /*
  311. ** Zortech
  312. */
  313.  
  314. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  315. #define BORLAND 1                       /* from a code standpoint */
  316. #undef NULL                             /* NULL must be undefined */
  317. #endif                                  /* any changes here must also */
  318.                                         /* be made in "windows.c" */
  319. /*
  320. ** BORLAND
  321. */
  322.  
  323. #ifdef __TURBOC__
  324. #ifndef BORLAND
  325. #define BORLAND 1
  326. #endif
  327. #endif
  328.  
  329. #if BORLAND
  330. #define MSC     1
  331. #define MSC4    1
  332. #define DLC     0
  333. #define CI86    0
  334. #define LC2     0
  335. #define LC3     0
  336. #define MIXPC   0
  337. #define AZTEC   0
  338. #ifdef __SMALL__                        /* small code, small data */
  339. #define SPTR    1
  340. #define LPTR    0
  341. #endif
  342. #ifdef __LARGE__                        /* large code, large data */
  343. #define SPTR    0
  344. #define LPTR    1
  345. #endif
  346. #ifdef __COMPACT__                      /* small code, large data */
  347. #define SPTR    0
  348. #define LPTR    1
  349. #endif
  350. #ifdef __MEDIUM__                       /* large code, small data */
  351. #define SPTR    1
  352. #define LPTR    0
  353. #endif
  354. #ifdef __HUGE__                         /* large code, large data */
  355. #define SPTR    0
  356. #define LPTR    1
  357. #endif
  358. #define LATTICE 1
  359. #endif
  360.  
  361. #define TRUE    1                       /* truth */
  362. #define FALSE   0                       /* lies */
  363. #define The_BOSS TRUE                   /* convienent equate */
  364.  
  365. #include "stdio.h"                      /* standard header */
  366. #if CI86
  367. char *malloc(), *calloc();              /* for the OLD TIMER */
  368. #else
  369. #include "stdlib.h"                     /* For the rest */
  370. #endif
  371. #if LC6
  372. #include "string.h"                     /* Now for Lattice 6.XX */
  373. #endif
  374.  
  375. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  376. #if AZTEC
  377. #else
  378. #include "dos.h"                        /* Lattice stuff */
  379. #endif
  380. #endif
  381. #include "ctype.h"                      /* character conversion stuff */
  382. #if MSC4
  383. #include "stdarg.h"                     /* variable arg list marcos */
  384. #endif
  385.  
  386. #if AZTEC                               /* AZTEC DOS.H */
  387.  
  388. struct WORDREGS {
  389.     unsigned int ax;
  390.     unsigned int bx;
  391.     unsigned int cx;
  392.     unsigned int dx;
  393.     unsigned int si;
  394.     unsigned int di;
  395.     unsigned int cflag;
  396.     };
  397.  
  398. struct BYTEREGS {
  399.     unsigned char al, ah;
  400.     unsigned char bl, bh;
  401.     unsigned char cl, ch;
  402.     unsigned char dl, dh;
  403.     };
  404.  
  405. union REGS {
  406.     struct WORDREGS x;
  407.     struct BYTEREGS h;
  408.     };
  409.  
  410. struct SREGS {
  411.     unsigned int cs;
  412.     unsigned int ss;
  413.     unsigned int ds;
  414.     unsigned int es;
  415.     };
  416.  
  417. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  418. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  419.  
  420. struct RS {
  421.   int ax, bx, cx, dx, si, di, ds, es;
  422. };
  423. #endif                                  /* End AZTEC DOS.H */
  424.  
  425. #define SAVE    TRUE                    /* similar truth */
  426. #define RESTORE FALSE                   /* fibs */
  427. #define PAINT   TRUE                    /* screen update modes */
  428. #define FLASH   FALSE                   /* ditto */
  429. #define REPLACE 1                       /* for flicker free */
  430. #define ERASE   0                       /* scroll w_sapd & w_sapu */
  431. #define FAST    0x01                    /* fast retrace */
  432. #define SLOW    0x08                    /* slow retrace */
  433.  
  434. #define NULPTR  (char *) 0              /* null pointer */
  435. #define NUL     '\0'                    /* NUL char */
  436. #define NVAL    0                       /* null value - INTEGER */
  437. #define BEL     0x07                    /* beep */
  438. #define BS      0x08                    /* backspace */
  439. #define ESC     0x1b                    /* Escape */
  440. #define CR      0x0d                    /* carriage return */
  441. #define LF      0x0a                    /* linefeed */
  442. #define RUB     0x7f                    /* delete */
  443. #define NAK     0x15                    /* ^U */
  444. #define ETX     0x03                    /* ^C */
  445. #define CAN     0x18                    /* ^X */
  446. #define Del     0x53                    /* Del key scan code */
  447. #define ECHO    0x8000                  /* echo disable bit */
  448.  
  449. #define BIOS    0x01                    /* BIOS Scrolling */
  450. #define DMAS    0x02                    /* The BOSS's DMA Scrolling */
  451.  
  452. #define MO_LEFT   0                     /* Mouse left button */
  453. #define MO_RIGHT  1                     /* Mouse right button */
  454. #define MO_HDW    1                     /* Mouse hardware */
  455. #define MO_SFT    0                     /* Mouse software */
  456.  
  457. /*
  458. ** The following 2 equates are needed by Lattice Ver 2.XX (which is
  459. ** no longer "officially" supported.  Lattice Ver 2.XX users that need
  460. ** to work with larger Physical screens must change these constants here
  461. ** and in "windows.c". Other users can use the wns_ssiz() function.  Refer
  462. ** to wn_sup.c for usage.
  463. */
  464.  
  465. #define WN_MXROWS 25                    /* MAX PHYSICAL SCREEN */
  466. #define WN_MXCOLS 80                    /* MAX PHYSICAL SCREEN */
  467.  
  468. /*
  469. ** Externals
  470. */
  471.  
  472. extern int  wns_mouse;                  /* mouse in use flag */
  473. extern int  wni_mxrows;                 /* maximum PHYSICAL screen size */        
  474. extern int  wni_mxcols;                 /* maximum PHYSICAL screen size */
  475. extern int  wni_mxneed;                 /* maximum memory for screen img */
  476. extern int  wni_mxrbs;                  /* maximum # of bytes in a row */
  477. extern int  wni_mxrbs2;                 /* same as above, times 2 */
  478. extern int  wni_frmflg;                 /* data clerk (frmget) state */
  479. extern int wn_dmaflg;                   /* dma flag */
  480. extern char wn_sbit;                    /* retrace test bit 8 slow, 1 fast */
  481. extern int wn_blank;                    /* vidon & vidoff control flag */
  482. extern int wns_bchars[];                /* box chars */
  483. extern unsigned int wns_mtflg;          /* monitor type flag */
  484. extern int wns_cflag;                   /* close in progress flag */
  485.  
  486. extern struct SREGS wns_srp;            /* for segread */
  487.  
  488. extern unsigned wni_seg[];              /* for wns_push/pop */
  489. extern unsigned wni_off[];              /* ditto */
  490. extern unsigned wni_ptr[];              /* ditto */
  491.  
  492. #define BCUL  wns_bchars[0]             /* some shorthand for later */
  493. #define BCUR  wns_bchars[1]
  494. #define BCTB  wns_bchars[2]
  495. #define BCSD  wns_bchars[3]
  496. #define BCLL  wns_bchars[4]
  497. #define BCLR  wns_bchars[5]
  498.  
  499. /*
  500. ** Misc Stuff
  501. */
  502.  
  503. #if LC2
  504. extern unsigned wns_mtype();            /* make everyone happy */
  505. #endif
  506.  
  507. #define WMR   wn->bsize                 /* shorthand */
  508.  
  509. typedef struct wcb                      /* Window control block */
  510. {
  511. int ulx,                                /* upper left corner x coordinate */
  512.     uly,                                /* upper left corner y coordinate */
  513.     xsize,                              /* width of window - INSIDE dimension */
  514.     ysize,                              /* height of window -INSIDE dimension */
  515.     ccx,                                /* virtual cursor offset in window */
  516.     ccy,
  517.     style,                              /* attribute to be used in window */
  518.     bstyle,                             /* border attribute */
  519.     bsize;                              /* total border size 0 or 2 only */
  520. char *scrnsave;                         /* pointer to screen save buffer */
  521. int page,                               /* current video page being used */
  522.     oldx,                               /* cursor position when window was */
  523.     oldy,                               /* opened (used for screen restore) */
  524.     wrpflg,                             /* wrap flag */
  525.     synflg;                             /* cursor sync flag */
  526. char *handle;                           /* my own id */
  527.     char *prevptr;                      /* linked list - previous */
  528.     char *nextptr;                      /* linked list - next */
  529.     unsigned tmpseg;                    /* for activate */
  530.     unsigned tmpoff;                    /* ditto */
  531.     int  smeth;                         /* scroll method to use */
  532. } WINDOW, *WINDOWPTR;
  533.  
  534. extern WINDOWPTR wns_last;              /* last window opened */
  535.  
  536. typedef struct mcb                      /* Mouse control block */
  537. {
  538. int exists,                             /* TRUE if MOUSE exists */
  539.     nbuts,                              /* number of buttons */
  540.     bstat,                              /* button status */
  541.     nclik,                              /* number of clicks */
  542.     col,                                /* position - column */
  543.     row,                                /* position - row */
  544.     hmove,                              /* net horizontal movement */
  545.     vmove;                              /* net vertical movement */
  546.     char *handle;                       /* my own id */
  547. } MOUSE, *MOUSEPTR;         
  548.  
  549. union wi_args {                         /* variable arg type union */
  550.   int vi;                               /* (int) */
  551.   int *vip;                             /* (int *) */ 
  552.   unsigned int vui;                     /* (unsigned int) */
  553.   unsigned int *vuip;                   /* (unsigned int *) */
  554.   char vc;                              /* (char) */
  555.   char *vcp;                            /* (char *) */
  556.   long vl;                              /* (long) */
  557.   long *vlp;                            /* (long *) */
  558.   unsigned long vul;                    /* (unsigned long) */
  559.   unsigned long *vulp;                  /* (unsigned long *) */
  560.   float vf;                             /* (float) */
  561.   float *vfp;                           /* (float *) */
  562.   double vd;                            /* (double) */
  563.   double *vdp;                          /* (double *) */
  564. } ;
  565.  
  566. typedef struct wi_scb {                 /* screen control block */
  567.   char *pself;                          /* pointer to myself */
  568.   int fcode;                            /* input funtion code */
  569.   WINDOWPTR wn;                         /* the window */
  570.   int row;                              /* window (wn) location - row */
  571.   int col;                              /* window (wn) location - col */
  572.   char *prmpt;                          /* prompt string for field */
  573.   unsigned int atrib;                   /* input field attribute */
  574.   char fill;                            /* input field fill character */
  575.   union wi_args v1;                     /* whatever */
  576.   union wi_args v2;                     /* whatever */
  577.   union wi_args v3;                     /* whatever */
  578.   union wi_args v4;                     /* whatever */
  579.   union wi_args v5;                     /* whatever */
  580.   union wi_args v6;                     /* whatever */
  581.   union wi_args v7;                     /* whatever */
  582.   union wi_args v8;                     /* whatever */
  583. } WIFLD, *WIFLDPTR, **WIFORM;
  584.  
  585. #if MSCV3 | MSCV4 | BORLAND | DLC | LC3 /* allow for LINT_ARGS */
  586. #ifndef GENFNS
  587. #include "windows.fns"                  /* enforce type checking */
  588. #endif
  589. #else                                   /* and almost lint args */
  590. struct wcb *wn_open();
  591. struct wcb *wn_move();
  592. struct wcb *wn_save();
  593. struct mcb *mo_reset();
  594. char *wn_gets();
  595. char *wn_sleftj();
  596. char *wn_srightj();
  597. char *wn_scenter();
  598. char *wn_sdelspc();
  599. struct wcb *wn_save();
  600. struct wi_scb * *wn_frmopn();
  601. unsigned int wns_mtype();
  602. #endif
  603.  
  604. #define BLACK   0x00                    /* foreground */
  605. #define RED     0x04                    /* background */
  606. #define GREEN   0x02                    /* colors */
  607. #define YELLOW  0x06                    /* bg << 4 | fg */
  608. #define BLUE    0x01
  609. #define MAGENTA 0x05
  610. #define CYAN    0x03
  611. #define WHITE   0x07
  612. #define BLINK   0x80
  613. #define BOLD    0x08
  614. #define NDISPB  0x00                    /* non display black */
  615. #define NDISPW  0x77                    /* non display white */
  616. #define RVIDEO  0x70                    /* reverse video */
  617. #define UNLINE  0x01                    /* under line (BLUE) */
  618.  
  619. #define NVIDEO  0x07                    /* normal video */
  620. #define NORMAL  0x03                    /* cyan is normal for me */
  621.  
  622. /*
  623. ** Display Mode Atributes
  624. */
  625.  
  626. #define B4025  0                        /* black & white 40 x 25 */
  627. #define C4025  1                        /* color 40 x 25 */
  628. #define B8025  2                        /* black & white 80 x 25 */
  629. #define C8025  3                        /* color 80 x 25 */
  630. #define C320   4                        /* color graphics 320 x 200 */
  631. #define B320   5                        /* black & white graphics */
  632. #define HIRES  6                        /* B&W hi res 640 * 200 */
  633. #define MONO   7                        /* monocrome 80 x 25 */
  634.  
  635. /*
  636. ** Macro to set attribute byte
  637. */
  638.  
  639. #define v_setatr(bg,fg,blink,bold) ((blink|(bg<<4))|(fg|bold))
  640.  
  641. /*
  642. ** Key Scan Scodes & Window Input Stuff 
  643. */
  644.  
  645. #define BELL            0x0007          /* ring a ding */
  646. #define LARROW          0x4b00          /* left arrow */
  647. #define RARROW          0x4d00          /* right arrow */
  648. #define DARROW          0x5000          /* down arrow */
  649. #define UARROW          0x4800          /* up arrow */
  650. #define HOME            0x4700          /* home key */
  651. #define END             0x4f00          /* end key */
  652. #define INS             0x5200          /* insert key */
  653. #define DEL             0x5300          /* delete key */        
  654. #define F1              0x3b00          /* F1 aka HELP */
  655. #define HELP            F1              /* same as F1 */
  656. #define TAB             0x0f09          /* tab */
  657. #define BKTAB           0x0f00          /* back (shift) tab */
  658.  
  659.                                         /* 0 to 100 are reserved!! */
  660. #define GDONE  0                        /* end of list */
  661. #define GDATE  10                       /* wn_gdate */
  662. #define GTIME  11                       /* wn_gtime */
  663. #define GINT   12                       /* wn_gint */
  664. #define GUINT  13                       /* wn_guint */
  665. #define GLONG  14                       /* wn_glong */
  666. #define GFLOAT 15                       /* wn_gfloat */
  667. #define GPHONE 16                       /* wn_gphone */
  668. #define GTEXT  17                       /* wn_gtext */
  669. #define GBOOL  18                       /* wn_gbool */
  670. #define DTEXT  19                       /* Display text only */
  671. #define GPWORD 20                       /* wn_gpword */
  672. #define GULONG 21                       /* wn_gulong */
  673. #define GDOUBL 22                       /* wn_gdouble */
  674. #define GUTEXT 23                       /* wn_gutext */
  675. #define GLTEXT 24                       /* wn_gltext */
  676.                                         /* from above to 100 are reserved!! */
  677.  
  678. #define NSTR ""                         /* null string */
  679. #define NFRM (WIFORM)(0)                /* null form pointer */
  680. #define NFLD 0                          /* must be int 0 */
  681. #define SET  1                          /* form setup */
  682. #define XEQ  2                          /* immediate execution */
  683. #define MAXSTR 80                       /* max size - wn_gtext, wn_input */         
  684.  
  685. #define WNLPTR (WINDOWPTR) 0            /* A TRUE NULL WINDOW POINTER */
  686. #define MOLPTR (MOUSEPTR) 0             /* A TRUE NULL MOUSE POINTER */
  687.  
  688. /*
  689. ** FAR MEMORY MACROS
  690. */
  691.  
  692. #if MSCV3 | MSCV4
  693. #define FPSEG(fp) (*((unsigned *)&(fp) + 1))
  694. #define FPOFF(fp) (*((unsigned *)&(fp)))
  695. #endif
  696.  
  697. #if DLC
  698. #define FPOFF(fp) ((unsigned) ((char *)(fp) - (char *)0))
  699. #define FPSEG(fp) (((unsigned *) (&(fp)))[1])
  700. #endif
  701.  
  702. #if BORLAND 
  703. #define FPOFF(fp) ((unsigned)(fp))
  704. #define FPSEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
  705. #endif
  706.  
  707. #if LC3
  708. #define FPOFF(fp) (unsigned)FP_OFF( (char far *) fp)
  709. #define FPSEG(fp) (unsigned)FP_SEG( (char far *) fp)
  710. #endif
  711.  
  712. #if CI86
  713. unsigned wns_off();
  714. unsigned wns_seg();
  715. #define intdos  sysint21
  716. #define FPOFF(fp) (unsigned)wns_off(fp)
  717. #define FPSEG(fp) (unsigned)wns_seg(fp)
  718. #endif
  719.  
  720. #if LC2
  721. #define FPOFF(fp) wns_off(fp)
  722. #define FPSEG(fp) wns_seg(fp)
  723. #endif
  724.  
  725. /* End */
  726.